package com.seven.micro_service.service;

import com.seven.micro_service.DAO.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService {

    private UserDAO userDAO;
    @Autowired
    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    public boolean isAllowedLogin(String id, String pwd){
        try {
            return userDAO.getUserById(id).getPwd().equals(pwd);
        }catch (RuntimeException r){
            return false;
        }

    }

}
